package com.slliver.order.interceptor.feign;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * feign的拦截器:可以实现一些比如日志记录，统一参数转换等一些公共的业务
 */
public class CustomFeignRequestInterceptor implements RequestInterceptor {

    private static final Logger logger = LoggerFactory.getLogger(CustomFeignRequestInterceptor.class);

    @Override
    public void apply(RequestTemplate requestTemplate) {
        logger.info("feign http请求拦截器已启动...");
        logger.info("当前请求 ===>> " + requestTemplate.path());
        logger.info("当前请求方法类型 ===>> " + requestTemplate.method());
    }
}
